import Router from 'koa-router';


const router = new Router();

// 获取计数
router.get('/machine/active', (ctx) => {
  ctx.body = {
    success: true,
    msg: '系统检测成功',
    result: 0,
  };
});
// 获取计数
router.get('/machine/resize', (ctx) => {
  ctx.body = {
    success: false,
    msg: '暂未检测到可连接系统',
    result: null,
  };
});
// 获取计数
router.get('/machine/list', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [
      {
        name: '光感扫描机',
        cnt: '2',
        rate: '0.2%',
        num: 2,
        status: '离线'
      },
      {
        name: '油污检测仪',
        cnt: '3',
        rate: '0.9%',
        num: 3,
        status: '离线'
      },
      {
        name: '油污检测仪',
        cnt: '2',
        rate: '1.1%',
        num: 1,
        status: '离线'
      },
      {
        name: '色花感应器',
        cnt: '1',
        rate: '0.3%',
        num: 2,
        status: '离线'
      },
      {
        name: '霉斑检测仪',
        cnt: '3',
        rate: '1.1%',
        num: 3,
        status: '离线'
      },
      {
        name: '水渍检测仪',
        cnt: '1',
        rate: '0.2%',
        num: 1,
        status: '离线'
      }
    ],
  };
});
// 获取列表
router.get('/machine/finde', (ctx) => {
  ctx.body = {
    success: true,
    msg: null,
    result: [
      0.32,0.41,0.32,0.31,0.41,0.14,0.22,0.17,0.39,0.18,0,0
    ],
  };
});
export default router;
